package com.bz.zhrc;

import com.bz.zhrc.task.PushTask;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

@SpringBootApplication
public class ZhrcPushApplication {

    public static void main(String[] args) {
        ConfigurableApplicationContext context = SpringApplication.run(ZhrcPushApplication.class, args);
        if (args.length > 0){
            /*
            如果参数的长度大于零，就从容器中获取PushTask对象，并执行对象里的pukh方法
             */
            PushTask pushTask = context.getBean("pushTask", PushTask.class);
            pushTask.push();
        }
    }

}
